package com.web3.management.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

/**
 * 用户实体类
 *
 * @author Web3 Management Team
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "users")
public class User extends BaseEntity {

    /**
     * 用户名
     */
    @Column(name = "username", length = 50, unique = true, nullable = false)
    private String username;

    /**
     * 密码哈希值
     */
    @Column(name = "password_hash", nullable = false)
    private String passwordHash;

    /**
     * 是否启用
     */
    @Column(name = "enabled", nullable = false)
    private Boolean enabled = true;

    /**
     * 用户角色
     */
    @Column(name = "role", length = 20, nullable = false)
    private String role = "USER";
}